<?php
/**
 * <https://y.st./>
 * Copyright © 2018 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'<{title}>' => 'No more alchemy',
	'takedown' => '2017-11-01',
	'<{body}>' => <<<END
<img src="/img/CC_BY-SA_4.0/y.st./weblog/2018/08/10.jpg" alt="A street I cross every day on my way to work" class="framed-centred-image" width="649" height="480"/>
<section id="drudgery">
	<h2>Drudgery</h2>
	<p>
		My discussion post for the day:
	</p>
	<blockquote>
		<p>
			If you like expressive character faces, I recommend <a href="https://www.peppercarrot.com/">Pepper&amp;Carrot</a> and <a href="http://floraverse.com/">Floraverse</a>.
			Then again. you also mentioned liking simplicity in drawings.
			Most of Floraverse and all of Pepper&amp;Carrot is far from simple.
			Floraverse does have some simple sketched arcs though, such as <a href="http://floraverse.com/comic/seeds-war-is-hell/not-good-with-kids/575-not-good-with-kids/">Not Good With Kids</a>.
			They&apos;ve got plenty of story and expression, but without all the fancy artwork the rest of the comic uses.
		</p>
	</blockquote>
</section>
<section id="Minetest">
	<h2>Minetest</h2>
	<img src="/img/CC_BY-SA_3.0/minetest.net./weblog/2018/08/10.png" alt="There&apos;s a desert nearby." class="framed-centred-image" width="800" height="600"/>
	<p>
		I think I&apos;ve decided to discontinue Project Alchemy.
		I&apos;ve been spending my time trying to work around Minetest Game&apos;s lack of optimisation while figuring out how to optimise Project Alchemy&apos;s mods; the chimeric plant mods in particular.
		I think I would be better off spending my time trying to improve <code>minestats</code> itself.
		Yesterday was a great reminder of that.
		I worked on fixing a challenging issue in the <code>minestats</code> code, and even despite not finishing the patch, I feel like I&apos;ve accomplished more than I&apos;ve been accomplishing on the alchemy project.
	</p>
	<p>
		I think I want to work on a new subgame.
		Again.
		That&apos;s never gone well for me before, but maybe I can get it right this time.
		The premise will be that the whole point of the subgame will be to stretch <code>minestats</code> to its limits while building a coherent game.
		In particular, palettes will be used pretty heavily.
		Already, I&apos;ve realised some obstacles I&apos;ll face and come up with decent solutions.
		There are still some obstacles I have left to find solutions for, but I think it&apos;ll work out.
	</p>
	<p>
		One challenge I&apos;ll face, one that doesn&apos;t really have a solution, is that every counted drop will use a 256-colour palette, with each palette index representing what is essentially an entirely different item.
		For example, leaves drop saplings.
		That means I&apos;ll need 256 types of leaves and 256 types of saplings.
		That&apos;s 256 types of trees and bushes.
		The logs obtained need not be paletted though.
		They can use different textures for variety.
		Minables will be even trickier, I think.
		There&apos;ll be the lumps, such as iron lumps and coal lumps.
		But there&apos;ll also be the gems, such as diamonds.
		They can&apos;t simply be the same item with different palette indexes used because gems and metal lumps look far too different from one another.
		That means I&apos;ll need to define at least 512 minables: 256 lumps and 256 gems.
		Ingots will be interesting.
		Not every ingot will be paired to a lump or vice versa.
		For example, coal lumps shouldn&apos;t be smelted into ingots.
		That&apos;ll leave a spot open on the palette of the ingot item.
		However, tin and copper ingots can be mixed to form bronze ingots.
		Bronze has no lump form, because you can&apos;t mine it, so it could occupy the spot that would otherwise be reserved for coal, if it had an ingot form.
		With 256 lumps and 256 ingots, I&apos;m sure other similar oddities will come up.
	</p>
	<p>
		Another issue will be that Minetest doesn&apos;t allow paletted items to use a different description for each palette index.
		Per-stack description strings can be set, but that can&apos;t be done from the drop table on a per-palette-index basis.
		It&apos;ll make it hard to tell what lump is what material and what sapling grows what kind of tree or bush.
		Anything gotten from a drop will suffer from this problem, though anything gotten through crafting will not.
		That&apos;s because a custom craft handler can be set up to attach the correct description string to the stacks, but a custom drop handler would interfere with the way <code>minestats</code> operates.
		For lumps, if they were all metals, I could explain this away, saying you&apos;ve got to refine your metal to be able to properly identify it.
		However, the lump item will also represent items such as coal, which don&apos;t get refined.
		In other words, there&apos;d be no way to identify coal and get a proper description attached to it.
		There&apos;s also the problem of refined materials that have been placed and dug back up.
		A steel block would have a proper description when first crafted, for example, but that description is lost when the node is placed and dug back up.
		One option I&apos;ve considered is special book items that can be used to identify everything of a given type in your current inventory.
		For example, a book on gems would attach all correct descriptions to gem items.
		A book on metals would do the same for metals.
		A book on trees would fix the sapling descriptions.
	</p>
	<p>
		Having 256 of each category of drop will also make the stats menu rather crowded.
		I&apos;d love to build an itemised breakdown, so each type of drop has its own set of pages.
	</p>
	<p>
		Before I work on any of this though, I need to finish fixing <code>minestats</code>.
		Then, I&apos;ll probably need to copy over some base nodes form Minetest Game to get a basic, barren world set up, which I can begin to populate with the game aspects I described above.
		I&apos;ve gotten <code>minestats</code> mostly fixed today, with the exception of two complex and interrelated parts in a recursive function.
		Those these sections of code lie on different branches of execution, they still interact through the recursive nature of the function.
		I don&apos;t think I&apos;ll finish tomorrow, as I&apos;ll spend most of the day at the festival, but it&apos;s only a matter of time before <code>minestats</code> is back in working order, better than before.
	</p>
</section>
END
);
